/*
 * @Author: mayufo
 * @Date: 2021-06-23 11:02:00
 * @LastEditTime: 2021-06-23 11:30:14
 * @Description: 搜素关键字实现通信 两个互不影响的组件通信
 * @FilePath: /tsmusic/src/useSearchWord.ts
 */

import { provide, inject, Ref, ref } from "vue";

const StoreSymbol = Symbol()

export function provideStore(store:Ref<string>) {
    provide(StoreSymbol, store)
}

export function useStore() {
    const store = inject(StoreSymbol, ref(''))
    if (!store) {

    }

    return store
}